
#out = open("/data3/face/ffmpeg/ffmpeg-4.3.1-amd64-static/ps/20210127130801-20210127130807_ALARM.ps",'rb')
path = 'http://10.143.165.25/tmp/20210127130801-20210127130807_ALARM.ps'
import requests

out = requests.get(url=path).content
from io import BytesIO
out = BytesIO(out)
from av import open




import time

#video = open("/data3/face/ffmpeg/ffmpeg-4.3.1-amd64-static/ps/20210127130801-20210127130807_ALARM.ps")


for i in range(1):
    s  =time.time()
    #help(open)
    video = open(out)

    stream = next(s for s in video.streams if s.type == 'video')
    print(stream)
    for packet in video.demux(stream):
        for frame in packet.decode():
            if frame.key_frame:
                img = frame.to_ndarray(format='rgb24')
                print(img.shape)
    print(time.time()-s)
~                                